<?php

namespace App\Admin\Actions\Grid;


use App\Admin\Forms\AssetsForm;
use Dcat\Admin\Grid\RowAction;
use Dcat\Admin\Widgets\Modal;

class Assets extends RowAction
{
    protected $title = '<i class="feather icon-alert-triangle text-warning"></i> <span class="text-warning">资产变动</span> &emsp;';

    public function render()
    {
        // 实例化表单类并传递自定义参数
        $form = AssetsForm::make()->payload([
            'id' => $this->getKey(),
            'balance' => $this->row->balance,
            'points' => $this->row->points,
        ]);

        return Modal::make()
            ->lg()
            ->title($this->title)
            ->body($form)
            ->button($this->title);
    }

}
